<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <input type="text" id="fir">
    <select id="sel">
        <option>请选择</option>
        <option>+</option>
        <option>-</option>
        <option>*</option>
        <option>/</option>
    </select>
    <input type="text" id="sec">
    <input type="button" value="=">
    <input type="text" id="result">

    <script src="js/jquery.min.js"></script>
    <script>
        $('input:button').click(function() {
            // 获取id为fir的iuput框数值
            var num1 = parseFloat($('#fir').val());

            // 获取id为sec的input框数值
            var num2 = parseFloat($('#sec').val());

            // 获取+-*/
            symbol = $('#sel').val();

            // 根据select框获取的值,进行+-*/匹配
            switch (symbol) {
                case '+':
                    result = num1 + num2;
                    break;
                case '-':
                    result = num1 - num2;
                    break;
                case '*':
                    result = num1 * num2;
                    break;
                case '/':
                    result = num1 / num2;
                    break;
            };
            // console.log(result);
            // 将求出的结果赋值给id为result的input框
            $('#result').val(result);
        })
    </script>
</body>

</html>